package com.dailyblue.java.net.tcp.demo1;

import lombok.SneakyThrows;

import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.net.Socket;

public class Client {
    @SneakyThrows
    public static void main(String[] args) {
        // 产生客户端的套接字
        Socket socket = new Socket("localhost", 9999);
        // 客户端负责发送
        OutputStream out = socket.getOutputStream();
        out.write("Hello,world!".getBytes());
        out.close();
        socket.close();
    }
}
